<?php

$userid = get_loggedin_userid();
$friendid = get_input('friend_id');
$client_id = get_input('client_id');


if($client_id == OPINIONS) {
    accept_opinions_friend($friendid, $userid);
} else {
    accept_whiteboard_friend($friendid, $userid);
}

if($client_id == OPINIONS) {
    $result = check_opinions_friend($userid, $friendid);
} else {
    $result = check_whiteboard_friend($userid, $friendid);
}

echo json_encode(export_result(200, $result));

?>
